<?php
function view_sanggar($config,$param){
view_header($config,array(
    'page' => 'sanggar',
));
$twitter = (strlen($param['twitter'])>0) ? $param['twitter'] : "";
view_title(
    'SANGGAR BUDAYA',
    'http://placehold.it/100x100&text=CONTACT',
	$config['home_url'].'contact',
    $param['deskripsi']
); ?>
<!--script social media-->
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=147346958657510";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<!--script social media-->
<h2 style="font-size: 48px;">KOMUNITAS</h2>
<?php
foreach ($param['sanggar'] as $sanggar){
?>
<h3 class="agency subhide">
    <div id="<?php echo $sanggar['idSanggar']; ?>div"><a href="javascript:doubleToggle('<?php echo $sanggar['idSanggar']; ?>div','desc<?php echo $sanggar['idSanggar']; ?>')"><?php echo $sanggar['komunitas']; ?></a></div>
</h3>
<div id="desc<?php echo $sanggar['idSanggar']; ?>" style="display: none;">
    <div style="float: left;margin: 0 40px 0 -160px">
	<?php 
		echo "<a href=\"http://".$sanggar['link']."\" target=\"_blank\">";
		if ($sanggar['pp']=="")
			echo "<img src=\"http://placehold.it/120x120&amp;text=KOMUNITAS\" style=\"border-radius: 60px;\">";
		else
			echo "<img src=\"".$sanggar['pp']."\" style=\"border-radius: 60px;\">";
		echo "</a>";
	?>
    </div>
    <div style="float: left;margin: 0 20px 0 0;width: 200px;">
        <div>
            <div class="fb-like" data-href="http://<?php echo $_SERVER["SERVER_NAME"].$_SERVER['REQUEST_URI']; ?>" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false" data-font="segoe ui"></div>
            <a href="https://twitter.com/share" class="twitter-share-button" data-text="Balerupa Bimbel (http://<?php echo $_SERVER["SERVER_NAME"].$_SERVER['REQUEST_URI']; ?>)" data-via="<?php echo $twitter; ?>" data-related="<?php echo $twitter; ?>">Tweet</a>
        </div>
        <p style="font-size: 12px;line-height: 125%;margin: 10px 0"><?php echo str_replace("\n", "<br />", $sanggar['deskripsi']); ?></p>
    </div>
    <div style="background-color: #cccccc;float: right;height: 300px;width: 500px;">
	<?php
        if (count($sanggar['slide'])>0){
		  view_slide_narrow('slider'.$sanggar['idSanggar'], $sanggar['slide']);
        }
	?>
    </div>
    <div class="clear" style="height: 50px;"></div>
</div>
<?php
}
view_footer_1($config);
}